"We urge the government of Uganda to examine the basis for these charges carefully and to honour its commitments under the International Covenant for Civil and Political Rights," said a statement from the US embassy in Kampala.
On Wednesday, 14 of Dr Besigye's co-accused received bail, but when gunmen in black T-shirts arrived outside the court they refused to leave and returned to prison.
Mr Museveni has accused opposition politicians of inciting the riots and said he would use all means to stop them.
Mr Museveni's National Resistance Movement is meeting this week and is expected to endorse him as its presidential candidate in next year's elections.
Earlier this year, the UK and other donors withheld some aid to Uganda after the constitution was amended to allow Mr Museveni to run for a third term
Furious
On Wednesday, the BBC's Will Ross in Kampala said that after the judge granted the 14 defendants bail, armed men - not in regular army uniform - arrived in the High Court compound in minibuses.
They then stood at the exit to the High Court waiting for treason suspects to leave, our correspondent says.
Officials from Dr Besigye's Forum for Democratic Change (FDC) said it was too dangerous to release the accused to the unknown gunmen.
Opposition onlookers and lawyers were furious, accusing the military of invading the High Court, our correspondent says.
Earlier, Dr Besigye's wife Winnie Banyima, a former MP, told the BBC she thought the charges against her husband were "trumped up" and said he had suffered intimidation since he declared his intention to challenge the president before polls five years ago.
Once Mr Museveni's doctor, Dr Besigye ran against the president in 2001 before fleeing after the elections, saying his life was in danger.
Dr Besigye returned from four years of exile last month to large crowds of cheering supporters.
If found guilty of treason, he and 22 co-accused could face the death penalty.
Dr Besigye has previously denied allegations that he is linked to rebel groups.
The rape charge dates from an incident in 1997, allegedly involving the daughter of a friend.